﻿using System;

namespace Uranus.WeiStationAPI.Common
{
    /// <summary>
    /// 公用业务处理
    /// </summary>
    internal class BusinessCommon
    {
        /// <summary>
        /// 验证活期卖出
        /// </summary>
        /// <param name="desc">返回值</param>
        /// <returns></returns>
        public static bool VerCurrentProductSellTime(out string desc)
        {
            desc = string.Empty;
            //23:30-6:00禁止活期卖出
            object o = ConfigCenterWork.GetConfigValueByOperationType("everydaytime?typeid=25");
            if (o == null || o.ToString() == "")
            {
                desc = "系统异常，请稍后再试";
                return false;
            }
            if (o.ToString() != "success")
            {
                desc = o.ToString();
                return false;
            }
            return true;

        }

        /// <summary>
        /// 验证快速取现
        /// </summary>
        /// <param name="desc">返回值</param>
        /// <returns></returns>
        public static bool VerQuickCashTime(out string desc)
        {
            desc = string.Empty;
            object o = ConfigCenterWork.GetConfigValueByOperationType("everydaytime?typeid=26");
            if (o == null || o.ToString() == "")
            {
                desc = "系统异常，请稍后再试";
                return false;
            }
            if (o.ToString() != "success")
            {
                desc = o.ToString();
                return false;
            }
            return true;
        }

    }
}